package main

import "fmt"

func variable() {
	// declare vaiables
	var x int
	x = 10
	fmt.Println("x =", x)
	// declare and initialize variable
	var name string = "John"
	fmt.Println("name =", name)
	// declare and initialize variable with shorthand syntax
	var age = 22
	fmt.Println("age =", age)

	// declare multiple variables

	var (
		a int
		b string
		c bool
	)
	a = 10
	b = "Hello"
	c = true
	fmt.Println("a =", a)
	fmt.Println("b =", b)
	fmt.Println("c =", c)
	c = false
	var a1, a2 = 10, "Hello"
	fmt.Println("a1 =", a1)
	fmt.Println("a2 =", a2)

	const version = "1.0"
	fmt.Println("version =", version)
	const (
		name1 = "John"
		name2 = "Mary"
	)
	fmt.Println("name1 =", name1)
	fmt.Println("name2 =", name2)

	// declare and initialize variable with type conversion
	var y int8 = int8(10)
	fmt.Println("y =", y)

}
